From: Keir Fraser Date: Wed, 29 Jul 2009 08:19:13 +0000 (+0100) Subject: xend: pass-through Use pci_dict_to_bdf_str() in hvm_pci_device_create() X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13542 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=d1c98f05a1f9dedb1801a4da7db948e31efbd465;p=xen.git xend: pass-through Use pci_dict_to_bdf_str() in hvm_pci_device_create() * Use pci_dict_to_bdf_str() in hvm_pci_device_create() * Use pci_name instead of pci_str in error message, pci_str does not * exist Signed-off-by: Simon Horman Acked-by: Dexuan Cui --- diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 7742410a93..b505a3d86e 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -679,14 +679,10 @@ class XendDomainInfo: raise VmError("device is already inserted") # Test whether the devices can be assigned with VT-d - pci_name = '%04x:%02x:%02x.%x' % \ - (parse_hex(new_dev['domain']),\ - parse_hex(new_dev['bus']),\ - parse_hex(new_dev['slot']),\ - parse_hex(new_dev['func'])) + pci_name = pci_dict_to_bdf_str(new_dev) if pci_name in get_all_assigned_pci_devices(): raise VmError("failed to assign device %s that has" - " already been assigned to other domain." % pci_str) + " already been assigned to other domain." % pci_name) # Here, we duplicate some checkings (in some cases, we mustn't allow # a device to be hot-plugged into an HVM guest) that are also done in